(function() {
  "use strict";
  const globalThis = new Function("return this")();
  var $template = {
    getPrice(priceNum) {
      if (globalThis.$data.price === undefined) {
        return "$" + 0;
      }
      return "$" + globalThis.$data.price;
    },

    bindTap() {
      console.log("onclick!!");
      var result = $bridge.invoke(
        'utils.measureTextSync',
        {
          "text": "this is a text",
          "max-width": 100,
          "max-height": 30,
        }
      );
      console.log("utils.measureTestSync: ", result);
    },
  };

  var $expression = [
    () => 'title: ' + globalThis.$data.title,
    () => 'price: ' + $template.getPrice(),
    () => $template.bindTap(),
    () => globalThis.$data.image
  ];
  globalThis.$expression = $expression;
})();
